#include <allegro.h>
#include <stdio.h>
#include "object.h"

object::object(int seconds, int x, int speed_y, BITMAP *img) {
	this->seconds = seconds;

	this->x = x;
	this->y = 0;

	this->img = img;

	this->w = img->w;
	this->h = img->h;

	this->speed_y = speed_y;
}

bool object::exists(int seconds) {
	if (seconds > this->seconds) {
		return true;
	}

	return false;
}

void object::draw(BITMAP *buffer) {
	draw_sprite(buffer, this->img, this->x, this->y);
}

void object::move() {
	this->y += this->speed_y;
}

int object::is_out(int ground_y) {
	if (this->y > ground_y)
		return 1;

	return 0;
}

